from . import _common
import time


def Dormancy(num):
    """
    首先启动几个程序，休眠后判断程序进程是否还在
    :return:
    """
    commands = ["ukui-notebook", "kylin-usb-creator", "kylin-recorder", "kylin-service-support",
                "ukui-control-center"]
    for cmd in commands:
        _common.start_app(cmd)
        time.sleep(1)
    for i in range(num):
        _common.cmd_exec("sudo rtcwake -u -s 30 -m mem")
